local sk__gongshen = fk.CreateSkill {

  name = "sk__gongshen",

  tags = {  },

}



sk__gongshen:addEffect("active", {
  name = "sk__gongshen",
  anim_type = "drawcard",
  prompt = "#sk__gongshen",
  card_num = 2,
  target_num = 0,
  can_use = Util.TrueFunc,
  card_filter =function (self, player, to_select, selected)
      return #selected < 2 and not player:prohibitDiscard(Fk:getCardById(to_select))
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:throwCard(effect.cards, sk__gongshen.name, player, player)
    if not player.dead then
      player:drawCards(1, sk__gongshen.name)
    end
    if not player.dead and player:isWounded() and table.every(room.alive_players, function (p)
      return p:getHandcardNum() >= player:getHandcardNum()
    end) then
      room:recover({
        who = player,
        num = 1,
        recoverBy = player,
        skillName = sk__gongshen.name,
      })
    end
  end
})

return sk__gongshen